from plone.app.layout.viewlets.common import SearchBoxViewlet
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Acquisition import aq_inner
from zope.app.component.hooks import getSite


class SearchBoxViewlet(SearchBoxViewlet):
    render = ViewPageTemplateFile('tp/searchbox.pt')

    def get_id(self):
        site=getSite()
        return site.getId()

    def site_actions(self):
        context = aq_inner(self.context)
        pactions=context.portal_actions.listFilteredActionsFor(context)
        links=[]
        if pactions.has_key('socialnet'):
            links=pactions['socialnet']
        return links
